<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>污染统计</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
        function autoRowSpan(tb,row,col){
            var lastValue="",value="",pos=1;
            for(var i=row;i<tb.rows.length;i++){
                value = tb.rows[i].cells[col].innerText;
                if(lastValue == value){
                    tb.rows[i].deleteCell(col);
                    tb.rows[i-pos].cells[col].rowSpan = tb.rows[i-pos].cells[col].rowSpan+1;
                    pos++;
                }else{
                    lastValue = value;
                    pos=1;
                }
            }
        }
        $(document).ready(function(){
            autoRowSpan(contentTable,0,0);
            $("td,th").css({"text-align":"center","vertical-align":"middle"});
        });
	</script>
</head>
<body>
<ul class="nav nav-tabs">
	<li class="active"><a href="${ctx}/enterprise/count/article">污染量统计</a></li>
</ul>
<form:form id="searchForm" modelAttribute="article" action="${ctx}/enterprise/count/article" method="post" class="breadcrumb form-search">
	<div>
		<label>污染量：</label><sys:treeselect id="count" name="countId" value="${paramMap.id}" labelName="countName" labelValue="${paramMap.name}"
											title="污染量" url="/enterprise/count/treeData" module="article" cssClass="input-small" allowClear="true"/>
		<label>企业：</label><sys:treeselect id="office" name="officeId" value="${paramMap.office.id}" labelName="officeName" labelValue="${paramMap.office.name}"
											title="企业" url="/sys/office/treeData" cssClass="input-small" allowClear="true"/>
		<label>审批日期：</label><input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-small Wdate"
								   value="${paramMap.beginDate}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
		<label>验收日期：</label><input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-small Wdate"
								   value="${paramMap.endDate}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>&nbsp;&nbsp;
		<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
	</div>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
	<thead><tr><th>企业</th><th>项目名称</th><th>排放污染物种类</th><th>主要生产工艺及产污节点</th><th>行政处罚</th><th>污染量</th>
	<tbody>
	<c:forEach items="${list}" var="count">
		<tr>
			<td><a href="javascript:" onclick="$('#countId').val('${count.id}');$('#countName').val('${count.name}');$('#searchForm').submit();return false;">${count.name}</a></td>
			<td>${count.name}</td>
			<td>${count.pollutionCategory}</td>
			<td>${count.processAndNode}</td>
			<td>${count.administrativePenalty}</td>
			<%--<td><a href="javascript:" onclick="$('#officeId').val('${count.office.id}');$('#officeName').val('${count.office.name}');$('#searchForm').submit();return false;">${count.office.name}</a></td>--%>
		</tr>
	</c:forEach>
	</tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>